package com.beehoo.dcportal.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.beehoo.dcportal.common.base.BaseDao;
import com.beehoo.dcportal.common.base.BaseException;
import com.beehoo.dcportal.dao.ILeaderDao;
import com.beehoo.dcportal.model.LeaderBean;

public class LeaderDaoImpl  extends BaseDao implements ILeaderDao{
	
	private static final Logger logger = Logger.getLogger(LeaderDaoImpl.class);

	@SuppressWarnings("unchecked")
	@Override
	public List<LeaderBean> getLeaderList(String streetId) throws BaseException {
		List<LeaderBean> leaderList = new ArrayList<LeaderBean>();
		
		try {
			leaderList = (List<LeaderBean>)sqlMapClient.queryForList("portal-leader.getLeaderList", streetId);
			
			logger.info("领导列表-获取领导列表|#调用portal-leader.getLeaderList" +
					"中心编号："+streetId+",成功!");
		} catch (SQLException e) {
			logger.error("领导列表-获取领导列表|#调用portal-leader.getLeaderList" +
					"中心编号："+streetId+",失败!", e);
			throw new BaseException(e, "获取领导列表失败");
		}
		
		return leaderList;
	}
}
